﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ERP_CargoLeadEdit.aspx.cs" Inherits="CRM_Manager_ERP_CargoLeadEdit" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <title>耗材详情页</title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
    <script type="text/javascript">
        function Search() {
            store_CargoName.reload();
        }
        function Search2() {
            if (extcomb_CargoName.text == "") {
                store_CargoName.reload();
            }
        }
        function extcomb_CargoName_select() {
            Ext.net.DirectMethods.SetCombCurrentnameSelect(extcomb_CargoName.value);
        }

        function extcomb_CargoName_BeforeSelect() {
            if (extcomb_CargoName.mimicing == false)
                return false;
        }

        function SaveData(type) {
            //var validR = PanelCargo.form.isValid();
            //var checkR = FieldEmptyCheck2Trim(PanelCargo) && checkother();
            //if (validR && checkR) {
            Ext.net.DirectMethods.SaveData(type);
            //}
        }
        function closeWin() {
            var p = parent.Ext.getCmp('popwingy');
            if (p) {
                Closepopwin();
            } else {
                closeCurrTab();
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled">
    </ext:ResourceManager>
    <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
        <Items>
            <ext:Panel ID="PanelCargo" runat="server" Border="false" Height="500" AutoScroll="true" Layout="FitLayout">
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:Button ID="extBtn_Save" runat="server" Text="保存" Icon="Accept">
                                <Listeners>
                                    <Click Handler="SaveData('add');" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extBtn_Submit" runat="server" Text="提交" Icon="Accept">
                                <Listeners>
                                    <Click Handler="SaveData('submit');" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="extBtn_Close" runat="server" Text="关闭" Icon="Cancel">
                                <Listeners>
                                    <Click Fn="closeWin" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Content>
                    <ext:Panel runat="server" ID="CargoPanel" Border="false" Padding="5">
                        <Items>
                            <ext:FieldSet ID="FieldSet2" runat="server" Title="客户商品详情信息" >
                                <Items>
                                    <ext:Container runat="server" Layout="ColumnLayout" Height="150">
                                        <Items>
                                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                                <Items>
                                                    <ext:ComboBox runat="server" ID="extcomb_CustomId"  TabIndex="11" AnchorHorizontal="0.95"
                                                        Editable="false" ValueField="CustomerId" DisplayField="CustomerName" FieldLabel="客户名称">
                                                        <Store>
                                                            <ext:Store ID="Store1" runat="server">
                                                                <Reader>
                                                                    <ext:JsonReader IDProperty="CustomerId">
                                                                        <Fields>
                                                                            <ext:RecordField Name="CustomerId" />
                                                                            <ext:RecordField Name="CustomerName" />
                                                                        </Fields>
                                                                    </ext:JsonReader>
                                                                </Reader>
                                                            </ext:Store>
                                                        </Store>
                                                    </ext:ComboBox>
                                                    <ext:TextField runat="server" ID="exttxtf_CargoCode" TabIndex="3" FieldLabel="商品码"  AnchorHorizontal="0.95"></ext:TextField>                                                    
                                                    <ext:TextField runat="server" ID="exttxtf_Area" TabIndex="7" MaxLength="20" AllowBlank="false" FieldLabel="<font color='red' style='position:relative; top:2px;'>*</font>产地"  AnchorHorizontal="0.95"></ext:TextField>
                                                    <ext:RadioGroup ID="RadioGroup1" runat="server" FieldLabel="来源" TabIndex="10"  AnchorHorizontal="0.95">
                                                        <Items>
                                                            <ext:Radio runat="server" ID="extradio_ii1" BoxLabel="国产" Checked="true">
                                                            </ext:Radio>
                                                            <ext:Radio runat="server" ID="extradio_ii2" BoxLabel="进口">
                                                            </ext:Radio>
                                                        </Items>
                                                    </ext:RadioGroup>
                                                    <ext:ComboBox ID="extcomb_UseID"  AnchorHorizontal="0.95" runat="server" FieldLabel="商品用途"   TabIndex="12"
                                                        Editable="false" ValueField="Use_ID" DisplayField="Use_NAME">
                                                        <Store>
                                                            <ext:Store ID="Store_Use" runat="server">
                                                                <Reader>
                                                                    <ext:JsonReader IDProperty="Use_ID">
                                                                        <Fields>
                                                                            <ext:RecordField Name="Use_ID" />
                                                                            <ext:RecordField Name="Use_NAME" />
                                                                        </Fields>
                                                                    </ext:JsonReader>
                                                                </Reader>
                                                            </ext:Store>
                                                        </Store>
                                                    </ext:ComboBox>
                                                </Items>
                                            </ext:Container>
                                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                                <Items>
                                                    <ext:ComboBox runat="server" ID="extcomb_CargoName"  AnchorHorizontal="0.95"
                                                        AllowBlank="false" FieldLabel="<font color='red' >*</font>商品名称"
                                                        DisplayField="CargoName" ValueField="CargoId" TypeAhead="false" LoadingText="Searching..."
                                                        TriggerAction="All" ForceSelection="false" SelectOnFocus="true" Mode="Remote"
                                                        ItemSelector="div.search-item" MinChars="1" ListWidth="600" TabIndex="1" PageSize="10">
                                                        <Template ID="Template6" runat="server">
                                                            <Html>
                                                                <table width="100%" style="background-color: #f0f0f0; font-size: small; font-weight: bold">
                                                                    <tr>
                                                                        <td style="width: 20%;">商品名称</td>
                                                                        <td style="width: 20%;">规格</td>
                                                                        <td style="width: 20%;">型号</td>
                                                                        <td style="width: 20%;">生产厂家</td>
                                                                        <td style="width: 20%;">产地</td>
                                                                    </tr>
                                                                </table>
                                                                <tpl for=".">
                                                                    <div class="search-item">
                                                                        <table width="100%">
                                                                            <tr>
                                                                                <td style="width:20%;">{CargoName}</td>
                                                                                <td style="width:20%;">{Spec}</td>
                                                                                <td style="width:20%;">{Version}</td>
                                                                                <td style="width:20%;">{ProduceName}</td>
                                                                                <td style="width:20%;">{Area}</td>
                                                                            </tr>
                                                                        </table>
                                                                    </div>
                                                                </tpl>
                                                            </Html>
                                                        </Template>
                                                        <Listeners>
                                                            <Change Fn="Search"/>
                                                            <KeyDown Fn="Search2"/>
                                                            <Expand Fn="Search"/>
                                                            <Select Fn="extcomb_CargoName_select" />
                                                            <BeforeSelect Fn="extcomb_CargoName_BeforeSelect" />
                                                        </Listeners>
                                                        <DirectEvents>
                                                            <Blur OnEvent="OnNameBlur">
                                                                <ExtraParams>
                                                                    <ext:Parameter Name="targetField" Value="exttxtf_Spell" />
                                                                </ExtraParams>
                                                            </Blur>
                                                        </DirectEvents>
                                                        <Store>
                                                            <ext:Store runat="server" ID="store_CargoName"  RemotePaging="true" OnRefreshData="MyData_Refresh">
                                                                <Proxy>
                                                                    <ext:PageProxy>
                                                                    </ext:PageProxy>
                                                                </Proxy>
                                                                <Reader>
                                                                    <ext:JsonReader IDProperty="CargoId">
                                                                        <Fields>
                                                                            <ext:RecordField Name="CargoId" />
                                                                            <ext:RecordField Name="CargoName" />
                                                                            <ext:RecordField Name="Spec" />
                                                                            <ext:RecordField Name="Version" />
                                                                            <ext:RecordField Name="ProduceName" />
                                                                            <ext:RecordField Name="Area" />
                                                                        </Fields>
                                                                    </ext:JsonReader>
                                                                </Reader>
                                                            </ext:Store>
                                                        </Store>
                                                    </ext:ComboBox>
                                                    <ext:TextField runat="server" ID="exttxtf_ByName" TabIndex="4" FieldLabel="别名"  AnchorHorizontal="0.95"></ext:TextField>
                                                    <ext:TextField runat="server" ID="exttxtf_Spec" TabIndex="5" AllowBlank="false" FieldLabel="<font color='red'>*</font>规格" AnchorHorizontal="0.95" ></ext:TextField>
                                                    <ext:TextField runat="server" ID="exttxtf_ProduceName" TabIndex="8" MaxLength="20" AllowBlank="false" FieldLabel="<font color='red' >*</font>生产厂家"  AnchorHorizontal="0.95"></ext:TextField>                                                    
                                                    <ext:ComboBox runat="server" ID="extcomb_TypeId" TabIndex="11"  AnchorHorizontal="0.95"
                                                        Editable="false" ValueField="Type_ID" DisplayField="Type_NAME" FieldLabel="商品分类">
                                                        <Store>
                                                            <ext:Store ID="Store_Type" runat="server">
                                                                <Reader>
                                                                    <ext:JsonReader IDProperty="Type_ID">
                                                                        <Fields>
                                                                            <ext:RecordField Name="Type_ID" />
                                                                            <ext:RecordField Name="Type_NAME" />
                                                                        </Fields>
                                                                    </ext:JsonReader>
                                                                </Reader>
                                                            </ext:Store>
                                                        </Store>
                                                    </ext:ComboBox>
                                                </Items>
                                            </ext:Container>
                                            <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                                <Items>
                                                    <ext:TextField runat="server" ID="exttxtf_Spell" AnchorHorizontal="0.95" TabIndex="2" AllowBlank="true" FieldLabel="拼音码"></ext:TextField>                                                    
                                                    <ext:TextField runat="server" ID="exttxtf_Version" AnchorHorizontal="0.95" TabIndex="6" AllowBlank="false" FieldLabel="<font color='red' >*</font>型号"></ext:TextField>
                                                    <ext:TextField runat="server" ID="exttxtf_Unit" AnchorHorizontal="0.95" TabIndex="9" MaxLength="20" FieldLabel="单位"></ext:TextField>
                                                    <ext:NumberField runat="server" ID="exttxtf_Supplyprice" AnchorHorizontal="0.95" TabIndex="13" FieldLabel="供应价格"></ext:NumberField>                                                    
                                                </Items>
                                            </ext:Container>
                                        </Items>
                                    </ext:Container>
                                </Items>
                            </ext:FieldSet>
                        </Items>
                    </ext:Panel>
                </Content>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
